<html>
    
<head>
 <title>EasyRTC Client JsDocs</title>
 <link rel="stylesheet" type="text/css" href="jsdoc/styles/jsdoc-client.css" />

</head>

<body>
<div id="main">
    
    <h1 class="page-title">Client API - Class easyrtc</h1>
    
    



<section>
    
<article>    
    
    
    
    
    
    
    
    
    
    
    
        <hr/><hr/>

        <h2 class="subsection-title">Members</h2>
        
        <dl>
            
<dt>
    <h3 class="name" id="ackMessage"><span class="type-signature">&lt;static> </span>ackMessage<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Most basic message acknowledgment object
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="BECOMING_CONNECTED"><span class="type-signature">&lt;static> </span>BECOMING_CONNECTED<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Value returned by easyrtc.getConnectStatus if the other user is in the process of getting connected
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="errCodes"><span class="type-signature">&lt;static> </span>errCodes<span class="type-signature"> :Dictionary</span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Error codes that the EasyRTC will use in the errorCode field of error object passed to error handler set by easyrtc.setOnError. The error codes are short printable strings.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="initManaged"><span class="type-signature">&lt;static> </span>initManaged<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
        <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>now called easyrtc.easyApp.</li><ul></dd>
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="IS_CONNECTED"><span class="type-signature">&lt;static> </span>IS_CONNECTED<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Value returned by easyrtc.getConnectStatus if the other user is connected to us.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="myEasyrtcid"><span class="type-signature">&lt;static> </span>myEasyrtcid<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Your easyrtcid
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="nativeVideoHeight"><span class="type-signature">&lt;static> </span>nativeVideoHeight<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        The height of the local media stream video in pixels. This field is set an indeterminate periodof time after easyrtc.initMediaSource succeeds.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="nativeVideoWidth"><span class="type-signature">&lt;static> </span>nativeVideoWidth<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        The width of the local media stream video in pixels. This field is set an indeterminate periodof time after easyrtc.initMediaSource succeeds.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="NOT_CONNECTED"><span class="type-signature">&lt;static> </span>NOT_CONNECTED<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Value returned by easyrtc.getConnectStatus if the other user isn't connected to us.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="roomJoin"><span class="type-signature">&lt;static> </span>roomJoin<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        The rooms the user is in. This only applies to room oriented applications and is set at the sametime a token is received.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="usernameRegExp"><span class="type-signature">&lt;static> </span>usernameRegExp<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Regular expression pattern for user ids. This will need modification to support non US character sets
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        </dl>
    
    
    
        <hr/><hr />
        <h2 class="subsection-title">Methods</h2>
        
        <dl>
            
<dt>
    <h3 class="name" id="call"><span class="type-signature">&lt;static> </span>call<span class="signature">(otherUser, callSuccessCB, callFailureCB, wasAcceptedCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Initiates a call to another user. If it succeeds, the streamAcceptor callback will be called.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcid of the peer being called.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callSuccessCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(otherCaller, mediaType) - is called when the datachannel is established or the mediastream is established. mediaType will have a value of "audiovideo" or "datachannel"</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callFailureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(errorCode, errMessage) - is called if there was a system error interfering with the call.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>wasAcceptedCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(wasAccepted:boolean,otherUser:string) - is called when a call is accepted or rejected by another party. It can be left null.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.call( otherEasyrtcid,       function(easyrtcid, mediaType){          console.log("Got mediatype " + mediaType + " from " + easyrtc.idToName(easyrtcid));       },       function(errorCode, errMessage){          console.log("call to  " + easyrtc.idToName(otherEasyrtcid) + " failed:" + errMessage);       },       function(wasAccepted, easyrtcid){           if( wasAccepted ){              console.log("call accepted by " + easyrtc.idToName(easyrtcid));           }           else{               console.log("call rejected" + easyrtc.idToName(easyrtcid));           }       });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="cleanId"><span class="type-signature">&lt;static> </span>cleanId<span class="signature">(idString)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        A convenience function to ensure that a string doesn't have symbols that will be interpreted by HTML.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>idString</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    The cleaned string.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    console.log( easyrtc.cleanId('&hello'));</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="clearMediaStream"><span class="type-signature">&lt;static> </span>clearMediaStream<span class="signature">(element)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Clears the media stream on a video object.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>element</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">DomElement</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the video object.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.clearMediaStream( document.getElementById('selfVideo'));</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="connect"><span class="type-signature">&lt;static> </span>connect<span class="signature">(applicationName, successCallback, errorCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Connects to the EasyRTC signaling server. You must connect before trying tocall other users.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>applicationName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is a string that identifies the application so that different applications can have different       lists of users. Note that the server configuration specifies a regular expression that is used to check application names        for validity. The default pattern is that of an identifier, spaces are not allowed.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(easyrtcId, roomOwner) - is called on successful connect. easyrtcId is the  unique name that the client is known to the server by. A client usually only needs it's own easyrtcId for debugging purposes.      roomOwner is true if the user is the owner of a room. It's value is random if the user is in multiple rooms.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>errorCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(errorCode, errorText) - is called on unsuccessful connect. if null, an alert is called instead. The errorCode takes it's value from easyrtc.errCodes.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>  easyrtc.connect("mychat_app",                  function(easyrtcid, roomOwner){                      if( roomOwner){ console.log("I'm the room owner"); }                      console.log("my id is " + easyrtcid);                  },                  function(errorText){                      console.log("failed to connect ", erFrText);                  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="disconnect"><span class="type-signature">&lt;static> </span>disconnect<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Disconnect from the EasyRTC server.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.disconnect();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="doesDataChannelWork"><span class="type-signature">&lt;static> </span>doesDataChannelWork<span class="signature">(otherUser)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Checks to see if data channels work between two peers.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the other peer.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if data channels work and are ready to be used  between the two peers.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="dontAddCloseButtons"><span class="type-signature">&lt;static> </span>dontAddCloseButtons<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        By default, the easyApp routine sticks a "close" button on top of each callervideo object that it manages. Call this function(before calling easyApp) to disable that particular feature.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.dontAddCloseButtons();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="easyApp"><span class="type-signature">&lt;static> </span>easyApp<span class="signature">(applicationName, monitorVideoId, videoIds, onReady, onFailure)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Provides a layer on top of the easyrtc.initMediaSource and easyrtc.connect, assign the local media stream tothe video object identified by monitorVideoId, assign remote video streams tothe video objects identified by videoIds, and then call onReady. One of it'sside effects is to add hangup buttons to the remote video objects, buttonsthat only appear when you hover over them with the mouse cursor. This method will also add theeasyrtcMirror class to the monitor video object so that it behaves like a mirror.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>applicationName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">name of the application.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>monitorVideoId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the id of the video object used for monitoring the local stream.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>videoIds</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an array of video object ids (strings)</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>onReady</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function used on success. It is called with the easyrtcId this peer is knopwn to the server as.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>onFailure</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callbackfunction used on failure (failed to get local media or a connection of the signaling server).</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.easyApp('multiChat', 'selfVideo', ['remote1', 'remote2', 'remote3'],             function(easyrtcId){                 console.log("successfully connected, I am " + easyrtcId);             },             function(errorCode, errorText){                 console.log(errorText);             );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="easyAppBody"><span class="type-signature">&lt;static> </span>easyAppBody<span class="signature">(monitorVideoId, videoIds)</span><span class="type-signature"> &rarr; {void}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This is a helper function for the easyApp method. It manages the assignment of video streamsto video objects. It assumes
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>monitorVideoId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>videoIds</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">void</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableAudio"><span class="type-signature">&lt;static> </span>enableAudio<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets whether audio is transmitted by the local user in any subsequent calls.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enabled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to include audio, false to exclude audio. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>     easyrtc.enableAudio(false);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableAudioReceive"><span class="type-signature">&lt;static> </span>enableAudioReceive<span class="signature">(value)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Control whether the client requests audio from a peer during a call.Must be called before the call to have an effect.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>value</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">true to receive audio, false otherwise. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableCamera"><span class="type-signature">&lt;static> </span>enableCamera<span class="signature">(enable)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function is used to enable and disable the local camera. If you disable thecamera, video objects display it will "freeze" until the camera is re-enabled. *By default, a camera is enabled.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enable</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to enable the camera, false to disable it.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableDataChannels"><span class="type-signature">&lt;static> </span>enableDataChannels<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets whether WebRTC data channels are used to send inter-client messages.This is only the messages that applications explicitly send to other applications, not the WebRTC signaling messages.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enabled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to use data channels, false otherwise. The default is false.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.enableDataChannels(true);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableDebug"><span class="type-signature">&lt;static> </span>enableDebug<span class="signature">(enable)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Enable or disable logging to the console.Note: if you want to control the printing of debug messages, override the   easyrtc.debugPrinter variable with a function that takes a message string as it's argument.   This is exactly what easyrtc.enableDebug does when it's enable argument is true.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enable</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to turn on debugging, false to turn off debugging. Default is false.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.enableDebug(true);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableMicrophone"><span class="type-signature">&lt;static> </span>enableMicrophone<span class="signature">(enable)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function is used to enable and disable the local microphone. If you disablethe microphone, sounds stops being transmitted to your peers. By default, the microphoneis enabled.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enable</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to enable the microphone, false to disable it.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableVideo"><span class="type-signature">&lt;static> </span>enableVideo<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets whether video is transmitted by the local user in any subsequent calls.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enabled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to include video, false to exclude video. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>     easyrtc.enableVideo(false);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableVideoReceive"><span class="type-signature">&lt;static> </span>enableVideoReceive<span class="signature">(value)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Control whether the client requests audio from a peer during a call.Must be called before the call to have an effect.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>value</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">true to receive video, false otherwise. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getApplicationFields"><span class="type-signature">&lt;static> </span>getApplicationFields<span class="signature">()</span><span class="type-signature"> &rarr; {Dictionary}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get server defined fields associated with the current application. Only validafter a connection has been made.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A dictionary containing entries of the form {key:{'fieldname':key, 'fieldvalue':value1}}
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Dictionary</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getConnectionCount"><span class="type-signature">&lt;static> </span>getConnectionCount<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns the number of live peer connections the client has.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Number</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   ("You have " + easyrtc.getConnectionCount() + " peer connections");</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getConnectionFields"><span class="type-signature">&lt;static> </span>getConnectionFields<span class="signature">()</span><span class="type-signature"> &rarr; {Dictionary}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get server defined fields associated with the connection. Only validafter a connection has been made.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A dictionary containing entries of the form {key:{'fieldname':key, 'fieldvalue':value1}}
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Dictionary</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getConnectStatus"><span class="type-signature">&lt;static> </span>getConnectStatus<span class="signature">(otherUser)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Check if the client has a peer-2-peer connection to another user.The return values are text strings so you can use them in debugging output.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcid of the other user.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    one of the following values: easyrtc.NOT_CONNECTED, easyrtc.BECOMING_CONNECTED, easyrtc.IS_CONNECTED
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    if( easyrtc.getConnectStatus(otherEasyrtcid) == easyrtc.NOT_CONNECTED ){        easyrtc.call(otherEasyrtcid,                 function(){ console.log("success"); },                 function(){ console.log("failure"); });    }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getFreshIceConfig"><span class="type-signature">&lt;static> </span>getFreshIceConfig<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Request fresh ice config information from the server.This should be done periodically by long running applications.There are no parameters or return values.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getLocalStream"><span class="type-signature">&lt;static> </span>getLocalStream<span class="signature">()</span><span class="type-signature"> &rarr; {MediaStream}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns a media stream for your local camera and microphone. It can be called only after easyrtc.initMediaSource has succeeded. It returns a stream that can be used as an argument to easyrtc.setVideoObjectSrc.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">MediaStream</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setVideoObjectSrc( document.getElementById("myVideo"), easyrtc.getLocalStream());</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getLocalStreamAsUrl"><span class="type-signature">&lt;static> </span>getLocalStreamAsUrl<span class="signature">()</span><span class="type-signature"> &rarr; {URL}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns a URL for your local camera and microphone. It can be called only after easyrtc.initMediaSource has succeeded. It returns a url that can be used as a source by the Chrome video element or the &lt;canvas&gt; element.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">URL</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>     document.getElementById("myVideo").src = easyrtc.getLocalStreamAsUrl();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomApiField"><span class="type-signature">&lt;static> </span>getRoomApiField<span class="signature">(roomname, easyrtcid, fieldname)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns another peers API field, if it exists.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomname</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldname</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Undefined if the attribute does not exist, its value otherwise.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomField"><span class="type-signature">&lt;static> </span>getRoomField<span class="signature">(roomName, fieldName)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets a data field associated with a room.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the room.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the field.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    dataValue - the value of the field if present, undefined if not present.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomFields"><span class="type-signature">&lt;static> </span>getRoomFields<span class="signature">(roomName)</span><span class="type-signature"> &rarr; {Dictionary}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get server defined fields associated with a particular room. Only validafter a connection has been made.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the room you want the fields for.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A dictionary containing entries of the form {key:{'fieldname':key, 'fieldvalue':value1}} or undefinedif you are not connected to the room.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Dictionary</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomList"><span class="type-signature">&lt;static> </span>getRoomList<span class="signature">(callback, errorCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends the server a request for the list of rooms the user can see.You must have already be connected to use this function.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">on success, this function is called with a map of the form  { roomname:{"roomName":String, "numberClients": Number}}.The roomname appears as both the key to the map, and as the value of the "roomName" field.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>errorCallback</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">{Function} callback - is called on failure. It gets an errorCode and errorText as it's too arguments.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.getRoomList(       function(roomList){          for(roomName in roomList){             console.log("saw room " + roomName);          }        },        function(errorCode, errorText){           easyrtc.showError(errorCode, errorText);        }   );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomsJoined"><span class="type-signature">&lt;static> </span>getRoomsJoined<span class="signature">()</span><span class="type-signature"> &rarr; {Map}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get a list of the rooms you are in. You must be connected to call this function.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A map whose keys are the room names
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Map</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getSessionField"><span class="type-signature">&lt;static> </span>getSessionField<span class="signature">(name)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Fetch the value of a session field by name.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">name of the session field to be fetched.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    the field value (which can be anything). Returns undefined if the field does not exist.
</div>



        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getSessionFields"><span class="type-signature">&lt;static> </span>getSessionFields<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Fetch the collection of session fields as a map. The map has the structure: {key1: {"fieldName": key1, "fieldValue": value1}, ...,  key2: {"fieldName": key2, "fieldValue": value2} }
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="hangup"><span class="type-signature">&lt;static> </span>hangup<span class="signature">(otherUser)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Hang up on a particular user or all users.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcid of the person to hang up on.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.hangup(someEasyrtcid);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="hangupAll"><span class="type-signature">&lt;static> </span>hangupAll<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Hangs up on all current connections.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.hangupAll();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="haveAudioTrack"><span class="type-signature">&lt;static> </span>haveAudioTrack<span class="signature">(easyrtcid)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if a particular peer2peer connection has an audio track.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">the id of the other caller in the connection. If easyrtcid is not supplied, checks the local media.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if there is an audio track or the browser can't tell us.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="haveVideoTrack"><span class="type-signature">&lt;static> </span>haveVideoTrack<span class="signature">(easyrtcid)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if a particular peer2peer connection has a video track.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">the id of the other caller in the connection. If easyrtcid is not supplied, checks the local media.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if there is an video track or the browser can't tell us.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="idToName"><span class="type-signature">&lt;static> </span>idToName<span class="signature">(easyrtcid)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Convert an easyrtcid to a user name. This is useful for labeling buttons and messagesregarding peers.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    the username associated with the easyrtcid, or the easyrtcid if there isno associated username.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   console.log(easyrtcid + " is actually " + easyrtc.idToName(easyrtcid));</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="initMediaSource"><span class="type-signature">&lt;static> </span>initMediaSource<span class="signature">(successCallback, errorCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Initializes your access to a local camera and microphone. Failure could be caused a browser that didn't support WebRTC, or by the usernot granting permission.If you are going to call easyrtc.enableAudio or easyrtc.enableVideo, you need to do it beforecalling easyrtc.initMediaSource.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>successCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">will be called when the media source is ready.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>errorCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is called with a message string if the attempt to get media failed.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>      easyrtc.initMediaSource(         function(){             easyrtc.setVideoObjectSrc( document.getElementById("mirrorVideo"), easyrtc.getLocalStream());         },         function(){              easyrtc.showError("no-media", "Unable to get local media");         });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="isNameValid"><span class="type-signature">&lt;static> </span>isNameValid<span class="signature">(name)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Checks if the supplied string is a valid user name (standard identifier rules)
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true for a valid user name
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   var name = document.getElementById('nameField').value;   if( !easyrtc.isNameValid(name)){       console.error("Bad user name");   }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="joinRoom"><span class="type-signature">&lt;static> </span>joinRoom<span class="signature">(roomName, roomParameters, successCB, failureCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This method allows you to join a single room. It may be called multiple times to be inmultiple rooms simultaneously. It may be called before or after connecting to the server.Note: the successCB and failureDB will only be called if you are already connected to the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>roomParameters</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">: application specific parameters, can be null.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">called once, with a roomname as it's argument, once the room is joined.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">called if the room can not be joined. The arguments of failureCB are errorCode, errorText, roomName.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="leaveRoom"><span class="type-signature">&lt;static> </span>leaveRoom<span class="signature">(roomName, successCallback, failureCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function allows you to leave a single room. Note: the successCB and failureDB arguments are optional and will only be called if you are already connected to the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A function which expects a roomName.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A function which expects the following arguments: errorCode, errorText, roomName.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.leaveRoom("freds_room");   easyrtc.leaveRoom("freds_room", function(roomname){ console.log("left the room")},                      function(errorCode, errroText, roomname){ console.log("left the room")});</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="loadStylesheet"><span class="type-signature">&lt;static> </span>loadStylesheet<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Load Easyrtc Stylesheet.  Easyrtc Stylesheet define easyrtcMirror class and some basic css class for using easyrtc.js.  That way, developers can overide it or use it's own css file minified css or package.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>      easyrtc.loadStylesheet();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="muteVideoObject"><span class="type-signature">&lt;static> </span>muteVideoObject<span class="signature">(videoObjectName, mute)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Mute a video object.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>videoObjectName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A DOMObject or the id of the DOMObject.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>mute</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to mute the video object, false to unmute it.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="sendData"><span class="type-signature">&lt;static> </span>sendData<span class="signature">(destUser, msgType, msgData, ackHandler)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends data to another user. This method uses datachannels if one has been set up, or websockets otherwise.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a string containing the easyrtcId of the other user.Specifying multiple fields restricts the scope of the destination (operates as a logical AND, not a logical OR).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an object which can be JSON'ed.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>ackHandler</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function which receives acknowledgments. May only be invoked in the websocket case.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.sendData(someEasyrtcid, "roomData",  {room:499, bldgNum:'asd'},      function ackHandler(msgType, msgData);   );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendDataP2P"><span class="type-signature">&lt;static> </span>sendDataP2P<span class="signature">(destUser, msgType, msgData)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends data to another user using previously established data channel. This method willfail if no data channel has been established yet. Unlike the easyrtc.sendWS method,you can't send a dictionary, convert dictionaries to strings using JSON.stringify first.What datatypes you can send, and how large a datatype depends on your browser.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(an easyrtcid)</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an object which can be JSON'ed.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.sendDataP2P(someEasyrtcid, "roomdata", {room:499, bldgNum:'asd'});</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendDataWS"><span class="type-signature">&lt;static> </span>sendDataWS<span class="signature">(destination, msgType, msgData, ackhandler)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends data to another user using websockets. The easyrtc.sendServerMessage or easyrtc.sendPeerMessage methodsare wrappers for this method; application code should use them instead.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destination</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">either a string containing the easyrtcId of the other user, or an object containing some subset of the following fields: targetEasyrtcid, targetGroup, targetRoom.Specifying multiple fields restricts the scope of the destination (operates as a logical AND, not a logical OR).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an object which can be JSON'ed.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>ackhandler</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">by default, the ackhandler handles acknowledgments from the server that your message was delivered to it's destination.However, application logic in the server can over-ride this. If you leave this null, a stub ackHandler will be used. The ackHandlergets passed a message with the same msgType as your outgoing message, or a message type of "error" in which casemsgData will contain a errorCode and errorText fields.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.sendDataWS(someEasyrtcid, "setPostalAddress", {room:499, bldgNum:'asd'},     function(ackmessage){         console.log("saw the following acknowledgment " + JSON.stringify(ackmessage));     }   );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendPeerMessage"><span class="type-signature">&lt;static> </span>sendPeerMessage<span class="signature">(destination, msgType, msgData, successCB, failureCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends a message to another peer on the easyrtcMsg channel.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destination</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">either a string containing the easyrtcId of the other user, or an object containing some subset of the following fields: targetEasyrtcid, targetGroup, targetRoom.Specifying multiple fields restricts the scope of the destination (operates as a logical AND, not a logical OR).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object with the message contents.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function(msgType, msgData)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function with results from the server.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function(errorCode, errorText)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function to handle errors.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.sendPeerMessage(otherUser, 'offer_candy', {candy_name:'mars'},            function(msgType, msgBody ){               console.log("message was sent");            },            function(errorCode, errorText){               console.log("error was " + errorText);            });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendServerMessage"><span class="type-signature">&lt;static> </span>sendServerMessage<span class="signature">(msgType, msgData, successCB, failureCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends a message to the application code in the server (ie, on the easyrtcMsg channel).
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object with the message contents.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function(msgType, msgData)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function with results from the server.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function(errorCode, errorText)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function to handle errors.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.sendServerMessage('get_candy', {candy_name:'mars'},            function(msgType, msgData ){               console.log("got candy count of " + msgData.barCount);            },            function(errorCode, errorText){               console.log("error was " + errorText);            });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setAcceptChecker"><span class="type-signature">&lt;static> </span>setAcceptChecker<span class="signature">(acceptCheck)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        easyrtc.setAcceptChecker sets the callback used to decide whether to accept or reject an incoming call.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>acceptCheck</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes the arguments (callerEasyrtcid, function():boolean ){}The acceptCheck callback is passed (as it's second argument) a function that should be called with eithera true value (accept the call) or false value( reject the call).</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>     easyrtc.setAcceptChecker( function(easyrtcid, acceptor){          if( easyrtc.idToName(easyrtcid) === 'Fred' ){             acceptor(true);          }          else if( easyrtc.idToName(easyrtcid) === 'Barney' ){             setTimeout( function(){ acceptor(true)}, 10000);          }          else{             acceptor(false);          }     });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setApplicationName"><span class="type-signature">&lt;static> </span>setApplicationName<span class="signature">(name)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Set the application name. Applications can only communicate with other applicationsthat share the same API Key and application name. There is no predefined set of applicationnames. Maximum length is
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setApplicationName('simpleAudioVideo');</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setCallCancelled"><span class="type-signature">&lt;static> </span>setCallCancelled<span class="signature">(callCancelled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the callCancelled callback. This will be called when a remote userinitiates a call to you, but does a "hangup" before you have a chance to get his video stream.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callCancelled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes an easyrtcid as an argument and a boolean that indicates whether the call was explicitly cancelled remotely (true), or actually accepted by the user attempting a call to the same party.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.setCallCancelled( function(easyrtcid, explicitlyCancelled){       if( explicitlyCancelled ){           console..log(easyrtc.idToName(easyrtcid) + " stopped trying to reach you");        }        else{           console.log("Implicitly called "  + easyrtc.idToName(easyrtcid));        }    });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setCookieId"><span class="type-signature">&lt;static> </span>setCookieId<span class="signature">(cookieId)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function sets the name of the cookie that client side library will look forand transmit back to the server as it's easyrtcsid in the first message.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>cookieId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setCredential"><span class="type-signature">&lt;static> </span>setCredential<span class="signature">(credential)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Set the authentication credential if needed.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>credential</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONifiable object.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setDataChannelCloseListener"><span class="type-signature">&lt;static> </span>setDataChannelCloseListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a callback that is called when a previously open data channel closes.The callback will be called with an easyrtcid as it's sole argument.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setDataChannelCloseListener( function(easyrtcid){           ("No longer connected to " + easyrtc.idToName(easyrtcid));   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setDataChannelOpenListener"><span class="type-signature">&lt;static> </span>setDataChannelOpenListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a callback that is called when a data channel is open and ready to send data.The callback will be called with an easyrtcid as it's sole argument.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setDataChannelOpenListener( function(easyrtcid){        easyrtc.sendDataP2P(easyrtcid, "greeting", "hello");   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setDisconnectListener"><span class="type-signature">&lt;static> </span>setDisconnectListener<span class="signature">(disconnectListener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the listener for socket disconnection by external (to the API) reasons.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>disconnectListener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes no arguments and is not called as a result of calling easyrtc.disconnect.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setDisconnectListener(function(){       easyrtc.showError("SYSTEM-ERROR", "Lost our connection to the socket server");   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setGotConnection"><span class="type-signature">&lt;static> </span>setGotConnection<span class="signature">(gotConnectionCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets an event handler that gets called when a connection to the signalingserver has or has not been made. Can only be called after calling easyrtc.easyApp.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>gotConnectionCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature (gotConnection, errorText)</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setGotConnection( function(gotConnection, errorText){       if( gotConnection ){           console.log("Successfully connected to signaling server");       }       else{           console.log("Failed to connect to signaling server because: " + errorText);       }   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setOnCall"><span class="type-signature">&lt;static> </span>setOnCall<span class="signature">(cb)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets an event handler that gets called when a call is established.It's only purpose (so far) is to support transitions on video elements.This function is only defined after easyrtc.easyApp is called.The slot argument is the index into the array of video ids.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>cb</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature function(easyrtcid, slot){}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>  easyrtc.setOnCall( function(easyrtcid, slot){     console.log("call with " + easyrtcid + "established");  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setOnError"><span class="type-signature">&lt;static> </span>setOnError<span class="signature">(errListener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the easyrtc.onError field to a user specified function.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>errListener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes an object of the form {errorCode: String, errorText: String}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setOnError( function(errorObject){       document.getElementById("errMessageDiv").innerHTML += errorObject.errorText;   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setOnHangup"><span class="type-signature">&lt;static> </span>setOnHangup<span class="signature">(cb)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets an event handler that gets called when a call is ended.it's only purpose (so far) is to support transitions on video elements.
     x     * this function is only defined after easyrtc.easyApp is called.The slot is parameter is the index into the array of video ids.Note: if you call easyrtc.getConnectionCount() from inside your callbackit's count will reflect the number of connections before the hangup started.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>cb</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature function(easyrtcid, slot){}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>  easyrtc.setOnHangup( function(easyrtcid, slot){     console.log("call with " + easyrtcid + "ended");  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setOnStreamClosed"><span class="type-signature">&lt;static> </span>setOnStreamClosed<span class="signature">(onStreamClosed)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a callback to receive notification of a media stream closing. The usual use of this is to clear the source of your video object so you aren't left with the last frame of the video displayed on it.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>onStreamClosed</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes an easyrtcid as it's first parameter.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.setOnStreamClosed( function(easyrtcid){        easyrtc.setVideoObjectSrc( document.getElementById("callerVideo"), "");        ( easyrtc.idToName(easyrtcid) + " went away");    });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setPeerListener"><span class="type-signature">&lt;static> </span>setPeerListener<span class="signature">(listener, msgType, source)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a listener for data sent from another client (either peer to peer or via websockets).If no msgType or source is provided, the listener applies to all events that aren't otherwise handled.If a msgType but no source is provided, the listener applies to all messages of that msgType that aren't otherwise handled.If a msgType and a source is provided, the listener applies to only message of the specified type coming from the specified peer.The most specific case takes priority over the more general.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature (easyrtcid, msgType, msgData, targeting).  msgType is a string. targeting is null if the message was received using WebRTC data channels, otherwise it  is an object that contains one or more of the following string valued elements {targetEasyrtcid, targetGroup, targetRoom}.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a string, optional.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>source</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the sender's easyrtcid, optional.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.setPeerListener( function(easyrtcid, msgType, msgData, targeting){        ("From " + easyrtc.idToName(easyrtcid) +            " sent the following data " + JSON.stringify(msgData));    });    easyrtc.setPeerListener( function(easyrtcid, msgType, msgData, targeting){        ("From " + easyrtc.idToName(easyrtcid) +            " sent the following data " + JSON.stringify(msgData));    }, 'food', 'dkdjdekj44--');    easyrtc.setPeerListener( function(easyrtcid, msgType, msgData, targeting){        ("From " + easyrtcid +            " sent the following data " + JSON.stringify(msgData));    }, 'drink');</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setRoomApiField"><span class="type-signature">&lt;static> </span>setRoomApiField<span class="signature">(roomName, fieldName, fieldValue)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Provide a set of application defined fields that will be part of this instancesconfiguration information. This data will get sent to other peers via the websocketpath.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldName</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">the name of the field.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldValue</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the value of the field.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>  easyrtc.setRoomApiFields("trekkieRoom",  "favorite_alien", "Mr Spock");  easyrtc.setRoomOccupantListener( function(roomName, list){     for( var i in list ){        console.log("easyrtcid=" + i + " favorite alien is " + list[i].apiFields.favorite_alien);     }  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setRoomEntryListener"><span class="type-signature">&lt;static> </span>setRoomEntryListener<span class="signature">(handler)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Set a callback that will be invoked when the application enters or leaves a room.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>handler</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the first parameter is true for entering a room, false for leaving a room. The second parameter is the room name.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>  easyrtc.setRoomEntryListener(function(entry, roomName){      if( entry ){          console.log("entering room " + roomName);      }      else{          console.log("leaving room " + roomName);      }  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setRoomOccupantListener"><span class="type-signature">&lt;static> </span>setRoomOccupantListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Set the callback that will be invoked when the list of people logged in changes.The callback expects to receive a room name argument, and a map whose ideas are easyrtcids and whose values are in turn mapssupplying user specific information. The inner maps have the following keys: username, applicationName, browserFamily, browserMajor, osFamily, osMajor, deviceFamily. The third argument is the listener is the innerMap for the connections own data (not needed by most applications).
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>  easyrtc.setRoomOccupantListener( function(roomName, list, selfInfo){     for( var i in list ){        ("easyrtcid=" + i + " belongs to user " + list[i].username);     }  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setScreenCapture"><span class="type-signature">&lt;static> </span>setScreenCapture<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function requests that screen capturing be used to provide the local media sourcerather than a webcam. If you have multiple screens, they are composited side by side.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setScreenCapture();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setServerListener"><span class="type-signature">&lt;static> </span>setServerListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a listener for messages from the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature (msgType, msgData, targeting)</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.setServerListener( function(msgType, msgData, targeting){        ("The Server sent the following message " + JSON.stringify(msgData));    });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setSocketUrl"><span class="type-signature">&lt;static> </span>setSocketUrl<span class="signature">(socketUrl)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the url of the Socket server.The node.js server is great as a socket server, but it doesn't haveall the hooks you'd like in a general web server, like PHP or Pythonplug-ins. By setting the serverPath your application can get it's regularpages from a regular webserver, but the EasyRTC library can still reach thesocket server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>socketUrl</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">DOMString</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>    easyrtc.setSocketUrl(":8080");</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setStreamAcceptor"><span class="type-signature">&lt;static> </span>setStreamAcceptor<span class="signature">(acceptor)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        easyrtc.setStreamAcceptor sets a callback to receive media streams from other peers, independentof where the call was initiated (caller or callee).
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>acceptor</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes arguments (caller, mediaStream)</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code> easyrtc.setStreamAcceptor(function(easyrtcid, stream){    document.getElementById('callerName').innerHTML = easyrtc.idToName(easyrtcid);    easyrtc.setVideoObjectSrc( document.getElementById("callerVideo"), stream); });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setUsername"><span class="type-signature">&lt;static> </span>setUsername<span class="signature">(username)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the user name associated with the connection.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>username</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">must obey standard identifier conventions.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if the call succeeded, false if the username was invalid.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   if( !easyrtc.setUsername("JohnSmith") ){       console.error("bad user name);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setVideoBandwidth"><span class="type-signature">&lt;static> </span>setVideoBandwidth<span class="signature">(kbitsPerSecond)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the bandwidth for sending video data.Setting the rate too low will cause connection attempts to fail. 40 is probably good lower limit.The default is 50. A value of zero will remove bandwidth limits.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>kbitsPerSecond</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is rate in kilobits per second.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setVideoBandwidth( 40);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setVideoDims"><span class="type-signature">&lt;static> </span>setVideoDims<span class="signature">(width, height)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function is used to set the dimensions of the local camera, usually to get HD. If called, it must be called before calling easyrtc.initMediaSource (explicitly or implicitly). assuming it is supported. If you don't pass any parameters, it will default to 720p dimensions.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>width</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">in pixels</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>height</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">in pixels</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Examples</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setVideoDims(1280,720);</code></pre>

    <pre class="prettyprint"><code>   easyrtc.setVideoDims();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setVideoObjectSrc"><span class="type-signature">&lt;static> </span>setVideoObjectSrc<span class="signature">(videoObject, stream)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a video or audio object from a media stream. Chrome uses the src attribute and expects a URL, while firefox uses the mozSrcObject and expects a stream. This procedure hides that from you. If the media stream is from a local webcam, you may want to add the easyrtcMirror class to the video object so it looks like a proper mirror. The easyrtcMirror class is defined in easyrtc.css. Which is could be added using the same path of easyrtc.js file to an HTML file
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>videoObject</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">DOMObject</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an HTML5 video object</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>stream</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">MediaStream</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a media stream as returned by easyrtc.getLocalStream or your stream acceptor.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.setVideoObjectSrc( document.getElementById("myVideo"), easyrtc.getLocalStream());</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="showError"><span class="type-signature">&lt;static> </span>showError<span class="signature">(messageCode, message)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Default error reporting function. The default implementation displays error messages in a programmatically created div with the id easyrtcErrorDialog. The div has title component with a class name of easyrtcErrorDialog_title. The error messages get added to a container with the id easyrtcErrorDialog_body. Each error message is a text node inside a div with a class of easyrtcErrorDialog_element. There is an "okay" button with the className of easyrtcErrorDialog_okayButton.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>messageCode</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">An error message code</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>message</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the error message text without any markup.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>     easyrtc.showError("BAD_NAME", "Invalid username");</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="supportsDataChannels"><span class="type-signature">&lt;static> </span>supportsDataChannels<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines whether the current browser supports the new data channels.EasyRTC will not open up connections with the old data channels.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="supportsGetUserMedia"><span class="type-signature">&lt;static> </span>supportsGetUserMedia<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if the local browser supports WebRTC GetUserMedia (access to camera and microphone).
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    True getUserMedia is supported.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="supportsPeerConnections"><span class="type-signature">&lt;static> </span>supportsPeerConnections<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if the local browser supports WebRTC Peer connections to the extent of being able to do video chats.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    True if Peer connections are supported.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="updatePresence"><span class="type-signature">&lt;static> </span>updatePresence<span class="signature">(state, statusText)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the presence state on the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>state</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">one of 'away','chat','dnd','xa'</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>statusText</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">User configurable status string. May be length limited.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>   easyrtc.updatePresence('dnd', 'sleeping');</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="usernameToIds"><span class="type-signature">&lt;static> </span>usernameToIds<span class="signature">(username, room)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get an array of easyrtcids that are using a particular username
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>username</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the username of interest.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>room</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional room name argument limiting results to a particular room.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    an array of {easyrtcid:id, roomName: roomName}.
</div>



        
    
    
</dd>

        </dl>
    
    
    
    
    
</article>

</section>  




</div>


<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Wed Mar 05 2014 13:15:37 GMT-0800 (PST)
</footer>

<script> prettyPrint(); </script>
</body>
</html>